@isTest (SeeAllData=true)
private class Ann_Tsk_Std_Cntlr_TestClass {   
 // Methods for testing 
static testMethod void testMycontroller()
  {

      //Use the PageReference Apex class to instantiate a page
       //PageReference pageRef = new PageReference(Page.Ann_Task_List​);
       PageReference pageRef = new PageReference('/apex/Ann_Task_List');
       Test.setCurrentPage(pageRef); 
       
       //In this case, the Visualforce page named 'success' is the starting point of this test method. 
       //Test.setCurrentPage(pageRef);
     
       //Instantiate and construct the controller class.   
       Ann_Tsk_Std_Cntlr controller = new Ann_Tsk_Std_Cntlr();
      
      Announcement__c Ann_c = new Announcement__c();
      Ann_c.Name = 'ABC';
      insert Ann_c;
      
      controller.geta_tasks();
      controller.getAtask_New();
      controller.save_new_task_edit_ann();
      A_Task__c AnnTask_c = new A_Task__c();
      AnnTask_c.Name ='ABC';
      AnnTask_c.Announcement__c = Ann_c.Id;
      //insert AnnTask_c;
      controller.Atask_New = AnnTask_c;
      controller.save_new_task();
      
      Account Acount = new Account(name='ABC');
      insert Acount;
      
      Contact contact1 = new Contact();
      contact1.LastName = 'lastname1';
      contact1.Firstname = 'firstname1';
      contact1.email = 'elias.almanza@softtek.com';
      contact1.AccountId= Acount.Id;
      insert contact1;
      
      Profile p = [SELECT Id FROM Profile WHERE Name='Custom - Portal Employee']; 
      User Usr = new User(Alias = 'empltest', Email='elias.almanza@softtek.com', 
      EmailEncodingKey='UTF-8', LastName='Testing', LanguageLocaleKey='en_US', 
      LocaleSidKey='en_US', ProfileId = p.Id,  CurrencyIsoCode='USD', 
      TimeZoneSidKey='America/Los_Angeles', UserName='employeetest@softtek.com', ContactId=contact1.Id);
//      Usr.ContactId = contact1; 
      insert Usr;
      
      controller.getAtaskUser_New();
      A_Task_User__c AnnTskUsr_c = new A_Task_User__c();
      AnnTskUsr_c.Announcement_Task__c = AnnTask_c.Id;
      AnnTskUsr_c.User__c = Usr.Id;
      //insert AnnTskUsr_c;
      controller.AtaskUser_New = AnnTskUsr_c;
      controller.save_new_taskuser();
      
      List<Announcement__c> list_a_c = [SELECT Id FROM Announcement__c WHERE Name='ABC' LIMIT 1];

//      List<Contact> contacts = [SELECT Id,firstname FROM Contact WHERE LastName = '123'];
      
      ID id_a_c = list_a_c[0].Id;
//      OutboundEmails(Announcement_Controller controller)


       

       //Example of calling an Action method. Same as calling any other Apex method. 
       //Normally this is executed by a user clicking a button or a link from the Visualforce
       //page, but in the test method, just test the action method the same as any 
       //other method by calling it directly. 

       //The .getURL will return the page url the Save() method returns.
       //String nextPage = controller.save().getUrl();

       
       //Add parameters to page URL
       //ApexPages.currentPage().getParameters().put('qp', 'yyyy');
     
      
       //Example of calling the 'setter' method for several properties. 
       //Normally these setter methods are initiated by a user interacting with the Visualforce page, 
       //but in a test method, just call the setter method directly. 
       controller.fieldContainer = null;
       controller.getfieldContainer();
       controller.geta_tasks();
       controller.Atask_std_New();
       controller.Atask_std_Open();
       controller.processRequests();
       controller.Filtro = '';
       controller.geta_tasks();
       controller.processRequests();
       controller.AtaskUser_Open();
       controller.openAtask();
       controller.save();
       controller.cancel();
       controller.Ataskuser_New();
       controller.verifyParameters();
       
       pageRef.getParameters().put('paramAtask_Id',AnnTask_c.Id);
       controller.verifyParameters();
       
       pageRef.getParameters().put('paramAnn_id',Ann_c.Id);
       controller.verifyParameters();
       
       controller.save_atask();
       controller.gotoTasks();
       controller.getAtask_New();
       
       
       AnnTask_c = new A_Task__c();
       AnnTask_c.Name ='DEF';
       AnnTask_c.Announcement__c = Ann_c.Id;
       controller.Atask_New = AnnTask_c;
       controller.save_new_task_edit_ann();
       
       controller.gotoAnnouncement();
       controller.Atask_New = null;
       controller.save_new_task_edit_ann();
       controller.gotoTask_Edit();
       //controller.AtaskUser_Id = AtaskUser_Id;
       controller.AtaskUser_Delete();
       //nextPage = controller.save().getUrl();

       //Verify that the success page displays
      // System.assertEquals('/apex/Ann_Task_List', nextPage);

      
  }
}